;layui.use(['myApi', 'myFaApi', 'myStorage', 'myUtil', 'myInit', "jquery", 'myMd5', "layer","form"],
    function(myApi, myFaApi, myStorage, myUtil, myInit, $, myMd5, layer,form) {

    $(function () {
        /**
         * 登录
         */
        $('#formLogin').on('click', function() {
            login();
        });
    })


    login = function () {
        var loginName = document.getElementById('loginName').value || '';
        if(!loginName || loginName == '') {
            myUtil.blueTips('手机号码必填', '#loginName');
            return;
        }
        var loginPass = document.getElementById('loginPass').value || '';
        if(!loginPass || loginPass == '') {
            myUtil.blueTips('登录密码必填', '#loginPass');
            return;
        }

        alert(loginName);
        return;

        $.myAjax({
            show:false,
            tip:false,
            url:myFaApi.login,
            data:{
                "loginName": loginName,
                "loginPass": $.md5(loginPass)
            },
            success:function(result) {
                myStorage.set(myApi.CURRENT_USER, result.content.user);
                myStorage.set(myApi.CURRENT_TOKEN, result.content.token);
                myStorage.set(myApi.CURRENT_PASSWORD, $.md5(loginPass));
                top.location.href = myApi.webs.index;
                return;
            },
            businessFail:function(result) {
                console.log(result.resultMsg);
            }
        });
    }    


})